<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" exclude-result-prefixes="xsl xe msxsl CM" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xe="http://www.CrossFactory.net/XmlEditor" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:ContentManager="http://www.CrossFactory.net/ContentManager/" xmlns:CM="http://www.CrossFactory.net/ContentManager/">
<xsl:import href="%URLGlobalXslt%" />
<xsl:output method="xml" version="1.0" omit-xml-declaration="yes" indent="no" />

  <xsl:template match="links">
    <div id="linksBloc">
      
      <xsl:call-template name="XmlEditorInfo" />
      <xsl:if test="$xe:editionMode = 'true'">
        <xsl:attribute name="style">padding-top:5px;padding-bottom:5px;</xsl:attribute>
      </xsl:if>
      <ul class="linksList">
          <xsl:apply-templates select="link" />
      </ul>
      <xsl:if test="count(link) = 0">
        <img src="{$applicationPath}Images/Transp.gif" width="10" height="50" />
      </xsl:if>
    </div>
  </xsl:template>
	
	
  <!--xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-->

  <xsl:template match="link">
    <xsl:variable name="hr" select="CM:GetUrl($applicationPath, $xe:contentLanguage, $hierarchy, href/text())"/>  
        <li>
          <xsl:call-template name="XmlEditorInfo" />
            <a>
              <xsl:call-template name="XmlEditorCancelClick">
                <xsl:with-param name="tooltip">
                  <xsl:value-of select="tooltip/text()" />
                </xsl:with-param>
              </xsl:call-template>
              <xsl:if test="$xe:editionMode = 'true'">
                <xsl:attribute name="xe:nodeName">hyperlink</xsl:attribute>
                <xsl:attribute name="xe:hyperlinkType">
                  <xsl:value-of select="@xe:hyperlinkType"/>
                </xsl:attribute>
                <xsl:attribute name="xe:realUrl">
                  <xsl:value-of select="href/text()"/>
                </xsl:attribute>
              </xsl:if>
              <xsl:choose>
                <xsl:when test="linkanchor[string-length(text()) != 0]">
                  <xsl:choose>
                    <xsl:when test="$hr != ''">
                      <xsl:attribute name="href">
                        <xsl:value-of select="$hr"/>#<xsl:value-of select="linkanchor/text()"/>
                      </xsl:attribute>
                    </xsl:when>
                    <xsl:otherwise>
                      <xsl:attribute name="href">
                        <xsl:value-of select="href/text()"/>#<xsl:value-of select="linkanchor/text()"/>
                      </xsl:attribute>
                    </xsl:otherwise>
                  </xsl:choose>
                </xsl:when>
                <xsl:otherwise>
                  <xsl:choose>
                    <xsl:when test="$hr != ''">
                      <xsl:attribute name="href">
                        <xsl:value-of select="$hr"/>
                      </xsl:attribute>
                    </xsl:when>
                    <xsl:otherwise>
                      <xsl:attribute name="href">
                        <xsl:value-of select="href/text()"/>
                      </xsl:attribute>
                    </xsl:otherwise>
                  </xsl:choose>
                </xsl:otherwise>
              </xsl:choose>
              <xsl:attribute name="target">
                <xsl:value-of select="target" />
              </xsl:attribute>
              <div class="linktext">
                  <xsl:value-of select="linklabel/text()" />
              </div>
              <div class="linkimg">
                  <xsl:apply-templates select="picture" />
              </div>
            </a>
        </li>
    </xsl:template>

  <xsl:template match="picture">
      <img>
        <xsl:call-template name="XmlEditorInfo" />
        <xsl:attribute name="class">noborder</xsl:attribute>
        <xsl:attribute name="src">
          <xsl:value-of select="$applicationPath" />_SiteNote/WWW/GetFile.aspx?uri=<xsl:value-of select="$xe:documentProviderName" />:<xsl:value-of select="uri"/>
        </xsl:attribute>
        <xsl:if test="string-length(height/text()) != 0">
          <xsl:attribute name="height">
            <xsl:value-of select="height/text()" />
          </xsl:attribute>
        </xsl:if>
        <xsl:if test="string-length(width/text()) != 0">
          <xsl:attribute name="width">
            <xsl:value-of select="width/text()"  />
          </xsl:attribute>
        </xsl:if>
      </img>     
  </xsl:template>
  
</xsl:stylesheet>

  

  